from PyQt5.Qt import *

class Window(QWidget):
    def __init__(self):
        super().__init__()
        self.setWindowTitle("PyQt5测试小程序")
        self.resize(400, 600)
        self.setup_ui()
    def setup_ui(self):
        self.label = QLabel(self)
        self.label.setText("小鸟")
        self.label.move(180, 10)
        self.label.setStyleSheet("font-size:12px;color:black")

        self.btn = QPushButton(self)
        self.btn.setText("点击按钮")
        self.btn.move(155, 30)

        self.textEdit=QPlainTextEdit(self)
        self.textEdit.setPlaceholderText("请输入文本")
        self.textEdit.move(100,70)
        self.textEdit.resize(60,20)

        self.textEdit2=QPlainTextEdit(self)
        self.textEdit2.setPlaceholderText("请输入文本2")
        self.textEdit2.move(170,70)
        self.textEdit2.resize(60,20)

        self.btn.clicked.connect(self.hd)

    def hd(self):
        #print(123)
        info1 = self.textEdit.toPlainText()
        info2 = self.textEdit2.toPlainText()
        #print(info1,type(info1),info2,type(info2))
        self.label.setText(str(int(info1)+int(info2)))


if __name__ == '__main__':
    import sys

    app = QApplication(sys.argv)
    window = Window()
    window.show()
    sys.exit(app.exec_())